import {adminUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建课程管理-配置
export function createSubjectConfig(data) {
  return request({
    url: adminUrl + '/study/subject-config/create',
    method: 'post',
    data: data
  })
}

// 更新课程管理-配置
export function updateSubjectConfig(data) {
  return request({
    url: adminUrl + '/study/subject-config/update',
    method: 'put',
    data: data
  })
}

// 删除课程管理-配置
export function deleteSubjectConfig(id) {
  return request({
    url: adminUrl + '/study/subject-config/delete?id=' + id,
    method: 'delete'
  })
}

// 获得课程管理-配置
export function getSubjectConfig(id) {
  return request({
    url: adminUrl + '/study/subject-config/get?id=' + id,
    method: 'get'
  })
}

export function getSubjectConfigBySubjectId(id) {
  return request({
    url: adminUrl + '/study/subject-config/getBySubjectId?id=' + id,
    method: 'get'
  })
}

// 获得课程管理-配置分页
export function getSubjectConfigPage(query) {
  return request({
    url: adminUrl + '/study/subject-config/page',
    method: 'get',
    params: query
  })
}

// 导出课程管理-配置 Excel
export function exportSubjectConfigExcel(query) {
  return request({
    url: adminUrl + '/study/subject-config/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
